//pages/designer/list.js
var api=require("../../utils/api.js");
var diyparams=require("../../utils/data.js");
Page({
    data:{
        list:[],
        count: 4,
        page: 1,
        listcount: 1
    },

    onLoad: function(options){
        this.loadswiper();
        this.loaddesigner(1,this.data.count);
        this.setData({
            paramsname: diyparams.params
        });
    },

    loadswiper(){
        api.get({
            url: "home/slides/5",
            success: data=>{
                if(data.code==1){
                    this.setData({
                        movies: data.data[0].items
                    })
                }
            }
        });
    },

    loaddesigner(page,count){
        api.get({
            url: "/portal/lists/getCategoryPostLists",
            data: {
                category_id: 3,
                filed: "post.id, post.post_title,post.more",
                page: page+','+count,
                is_top: 1,
                order: '-post.id'
            },
            success: data=>{
                if(data.code=='1'){
                    this.setData({
                        list: this.setData.list.concat(data.data.list),
                        page: page,
                        listcount: data.data.list.length
                    })
                }
            }
        })
    },

    loadmore(e){
        let page=this.data.page+1;
        this.loaddesigner(page,this.data.count);
    },

    onReady:function(){},
    onShow:function(){},
    onHide: function(){},
    onUnload: function(){},
    onPullDownRefresh: function(){},
    onReachBottom: function(){},
    onShareAppMessage: function () {}

})